
<%@page import="java.text.NumberFormat"%>
<%@page import="models.Inlink"%>
<%@page import="models.Domain"%>
<%@page import="controller.Utils"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Collections"%>

<%@page import="java.util.List"%>
<%@page contentType="text/html;charset=UTF-8" language="java"%>
<%
Domain list = (Domain) request.getAttribute("list");
Inlink inlink = (Inlink) request.getAttribute("inlink");
String domain = (String) request.getAttribute("domain");
NumberFormat nf = NumberFormat.getInstance();
String url = "out-link/"+domain;

String type = "cross";
String title = "Check "+type+" of website "+ domain;
String description = "Check "+type+" of website "+domain+".sites that link to "+domain+" website is synthesized by "+Utils.ValidDomain();
String keywords = domain+"check link,link,link in,linkout";
%>
<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>"/>
	<jsp:param name="description" value="<%=description %>"/>
	<jsp:param name="keywords" value="<%=keywords %>"/>
</jsp:include>

	<div id="mainContent">
            	<div class="adv-1 content-center">
                	<%@ include file='/adv/banner.jsp'%>
                </div>
                <div id="leftSideContent">
                	<div id="outlinkPage">
                        <section class="simpleBox box-grey clearafter">
                            <form method="get" action="/search-link" class="left">
                            	<input type="text" placeholder="Check link" name="name"/>
                                <button type="submit">Check link</button>
                            </form>
                        </section>
                        <section class="blockContent blockBlue">
                        	<h3 class="title">Cross link  ( <a href="/domain/<%=domain %>" class="whiteColor"><%=domain %></a> )</h3>
                            <ul class="infoDetail">
                            	<li><%@ include file='/adv/note.jsp'%></li>
                            	<li><span>Out link</span><span class="right">Check link</span></li>
		                        <%
								int end = 0;
			        		 		if(list!=null&&list.getOutLink()!=null&&!list.getOutLink().getValue().equals(""))
			        		 		{
			        		 	%>
			        		 	<%
			        		 			String[] arr = list.getOutLink().getValue().split(",");
			        		 			if(arr.length < 10)
										{
											end = arr.length;
										} else {
											end = 10;
										}
			        		 			for(int i=0;i < end;i++)
										{
			        		 	%>
					        		 		<li>
						        		 		<span><% if(!Utils.fomatDomain(arr[i]).trim().equals("")){ %><a href="/domain/<%=Utils.fomatDomain(arr[i]) %>"><%=Utils.fomatDomain(arr[i]) %></a><% } %></span>
						        		 		<% if(!Utils.fomatDomain(arr[i]).trim().equals("")){ %><a href="/link/<%=Utils.fomatDomain(arr[i]) %>" class="right"><%=Utils.fomatDomain(arr[i]) %></a><% } %>
						        		 	</li>
			        		 	<%
										}
			        		 		} else {
			        		 	%>
			        		 		
			        		 	<%
			        		 		}
			        		 	%>
			        		 	<li><span>In link</span><span class="right">Check link</span></li>
			        			<%
								int k=0;
			        		 		if(inlink!=null&&inlink.getInLink()!=null)
			        		 		{
			        		 	%>
			        		 	<%
			        		 			if(inlink.getInLink().size()<10)
										{
											end = inlink.getInLink().size();
										} else {
											end = 10;
										}
			        		 			for(int i=0;i < end;i++)
										{
			        		 				k++;
			        		 	%>
			        		 		<li>
				        		 		<span><a href="/domain/<%=Utils.fomatDomain(inlink.getInLink().get(i)) %>"><%=Utils.fomatDomain(inlink.getInLink().get(i)) %></a></span>
				        		 		<a href="/link/<%=Utils.fomatDomain(inlink.getInLink().get(i)) %>" class="right"><%=Utils.fomatDomain(inlink.getInLink().get(i)) %></a>
				        		 	</li>
			        		 	<%
										}
			        		 		} else {
			        	
			        		 		}
			        		 	%>
                            </ul>                            
                        </section>
                    </div>
                </div>
                <aside id="rightSideContent">
                	<div class="simpleBox box-blue">
                    	<ul id="sideMenu">
                        	<li><a href="/">Home</a></li>
                            <li><a href="/whois">Whois</a></li>
                            <li><a href="http://www.prapi.net" rel="nofollow">Pagerank</a></li>
                            <li><a href="/myip">Myip</a></li>
                            <li><a href="/contact">Contact us</a></li>
                        </ul>
                    </div>
                	<div><%@ include file='/adv/right.jsp'%></div>
                </aside>
                <div class="clearbreak"></div>
            </div>

<%@ include file='/layout/footer.jsp'%>